﻿using System.IO;
using UnityEditor;
using UnityEngine;

[CreateAssetMenu(fileName = "PositionArray", menuName = "Common/PositionArray", order = 0)]
public class PositionArray : ScriptableObject
{
    public Vector3[] positions;


    // [MenuItem("MyTools/ScriptableObjectTest")]
    // public static void CreateAsset(string assetPath, string name, Vector3[] positions)
    // {
    //     //创建数据
    //     PositionArray testData = ScriptableObject.CreateInstance<PositionArray>();
    //     //赋值
    //     testData.positions = positions;

    //     //检查保存路径
    //     if (!Directory.Exists(assetPath))
    //         Directory.CreateDirectory(assetPath);

    //     //删除原有文件，生成新文件
    //     string fullPath = assetPath + "/" + name + ".asset";
    //     if (Directory.Exists(fullPath))
    //     {
    //         fullPath = assetPath + "/" + name + "1.asset";
    //     }

    //     UnityEditor.AssetDatabase.DeleteAsset(fullPath);
    //     UnityEditor.AssetDatabase.CreateAsset(testData, fullPath);
    //     UnityEditor.AssetDatabase.Refresh();
    // }


}